import React from "react";
import HistoryScore from "../../../Common/svg/HistoryScore";
import Sequence from "../../../Common/svg/Sequence";
import UnlockPayment from "../../../Component/UnlockPayment";
import './index.css';
import Random from "../../../Common/svg/Random";
import Err from "../../../Common/svg/Err";
import RedStar from "../../../Component/RedStar";
import ExaminationServer from "../../../Server/Study/Examination";
import MessageUtil from "../../../utils/MessageUtil";

export default class  extends React.Component{
    
    constructor(props){
        super();
        let orderTest=[];
        ExaminationServer.OrederTestList()
        .then(response=>{
            for(let i=1;i<=response.data;i++){
                // console.log(i)
                orderTest.push(
                    <div className="MockExam_BtnLine" key={i}>
                        <UnlockPayment type=""  notShowBorder={true}  
                        src={"/mockExamStart/"+i} lefttext={"理论模拟测试"+i}
                         righttext="开始测试"/>
                    </div>
                );
            }
            this.setState({
                orderTest
            },()=>{
                MessageUtil.ChangeHeight();
            })
        })
        this.state={   
            orderTest
        }
    }
    // 课件
    
    render(){
        return(
            <div className="Courseware_Body">
               <div className="Courseware_Middle">
                    <div style={{marginTop:"0.2rem"}}><Sequence/></div>
                    <div className="Courseware_Middle_mulu">目录</div>
                    <div className="Courseware_Middle_right">
                        <span><HistoryScore/></span><span><font color="#5393EB">历史成绩</font></span>
                    </div>
                </div>
                <div className="MockExam_GreyBG">
                    <div className="MockExam_Info">
                        <RedStar/><span className="MockExam_Info_Node">总分：100分</span>
                        <RedStar/><span className="MockExam_Info_Node">时间：60分钟</span>
                    </div>
                    <div>
                        {this.state.orderTest}
                    </div>
                </div>
                
                <div className="Courseware_Middle">
                    <div style={{marginTop:"0.2rem"}}><Random/></div>
                    <div className="Courseware_Middle_mulu">随机考试</div>
                </div>
                <div className="MockExam_GreyBG">
                    <div className="MockExam_Info">
                        <RedStar/><span className="MockExam_Info_Node">T题库总数1200道</span>
                        <RedStar/><span className="MockExam_Info_Node">随机抽取100道进行测试</span>
                    </div>
                    <div className="MockExam_BtnLine">
                        <UnlockPayment type=""  notShowBorder={true} src="/mockExamStart/-1" lefttext="随机考试" righttext="开始测试"/>
                    </div>
                </div>

                <div className="Courseware_Middle">
                    <div style={{marginTop:"0.2rem"}}><Err/></div>
                    <div className="Courseware_Middle_mulu">错题库</div>
                </div>
                <div className="MockExam_GreyBG">
                    <div className="MockExam_Info">
                        <RedStar/><span className="MockExam_Info_Node">错题库测试</span> <RedStar/><span className="MockExam_Info_Node">更新时间：2020-01-01  23:21 </span><RedStar/>答题时间时间：60分钟
                    </div>
                    <div className="MockExam_BtnLine">
                        <UnlockPayment type=""  notShowBorder={true} src="/mockExamStart/-99" lefttext="错题库测试" righttext="开始测试"/>
                    </div>
                </div>
            </div>
        )
    }
}